package org.qufenqi.api.common;

import java.io.FileWriter;
import java.io.IOException;


public class AlipayConfig {

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号,开发时使用沙箱提供的APPID，生产环境改成自己的APPID
    public static String APP_ID = "2021000117688893"; //测试

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String APP_PRIVATE_KEY = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCCKmvywMRxg1cby5PgusuyrO5kpFQbRR2kNjV7MPgebiIsJnjxaWFbVYDmes7wabPgQxVKcYPjxfTpqBbc1PrKnEAQ+I1cOuoMfM1DWczQCFLreY+StpxliQWwNL8puejWdv22kRticYCr8Z0Q4v73tN1nXDY+L7gsPdf6+DdGktLyGXFxQLUdjWUeiTSQ6bbQEwOCFzypHlL/UPSSAqXzNqjPixKoSxGtw1gTRZ1FtSrgwCkpyIYSNQk2TkkvaufoIRnbAzFy4+ZSYvSoVZIp814aRY+9RLioCDohRZ0Mwjs/NE8lH2iRSNAwUi4EoWqe8rvGNK+5V2Yk0COhP3ZhAgMBAAECggEAJFs29YHUHKSDsxbEghOKi6hzmZawi0Fdyxz9CSCfXNiEIPLJ+xvk/n6+VyHcJRhRDoWOL9HO9dK32n+Bi0LNncPQvSy/RxCJiN1e873kUALTLkQwztjEjDOebB3/eucbWrO3n8Od83wiZWRB65KLhqJ06Ma/u9TWSz0m00l7HvHC62L0IAkPnw59WWQ7SXqma/hTM13bzVBBpIbNZa4C3Gubhv8q5COOUHkaZyQa4plP6BV+ZQ/OvF7djLFr6hzr/M9bAFmuCZ96Ng7xHu2PjQAi3/ExwjwrWVhtaHjUjE9XG1CmNjNWktrZdOKB7RRkKlN+rPrtppYNkdUfWNpxxQKBgQDMZTHIZkBgguRBRl/OQ1IngQ36+TKFgP8mtOZBwW0lk+eJrTlFIeXF04feS1XqvpFLMxzdLTOoELjOCb9ytxRtZ06dFWZl+DnaZAUcAeV/vpwCJJXGcm3hFA79E5cyhfWfVPWrIoNpZ/onLm88EXdASvWl/5EdMoYcBrG998bKTwKBgQCjB4BbrT3XqIS+phYeUzcI9SsAO1gpTUsy/h77wU5vUXiaRAc8LAfeVWUDfYcWW9bLQRe+zDtO+eWY3g8k2ZRcomyJnU+7DmWwY+HrpNkRBuO7HT/+DXyoM+l7BgOZmVTOOYtiZLx1q28hLB9ZnUNLHQuaCrJcJRCVp1F/KE54TwKBgQCU8x2/S3yYmGpcgztoJbkl3q9geN9vWN0XyPaPbrTqkIlH1HuKvLQkYQ1/WmknI27gXUQojjs5u83hIEtq/q4dOA6a/LBdmPIYC5GJonwrhq1MBns7XcJjJunxVah2ghbH4PMSnpkjZElw6i7XmGbN7JJtQPvwShRfMiWvKXStkwKBgBCOD3O/yNrgavJtLSvRKXKIauBwJkizZ6J6+ax4+b0GGegYZl+u3PGv3D0ZfyE/HDWxm3atiIxBhhYa3pDQY2dwuvLSfakyEhNyYRurtrsq5u82Tiw/NFxkQR5UAwOS9XCnmUbZkeWlDfjhYSGZfZ7gCTCQS4Jd5Sw9PGJcNnOzAoGBAK2CrwRl0jUVghyqA/oA9AMsPabLW5rC0nzt5XJaYVlD5U53yo0Kovw8XfcXmG+Q9NiBwRgNiJef5+h6CGS5xsW4TXSBPuuG6mJZ4zj+INBiTTy1pL39vGcZDzEHhMpe04JHdcTpaCrzTiJV2Md7kYoWmUT7EFdeMu/pIHcDbjU3";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String ALIPAY_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkfoi4RgnDK3qh52ubRyvhkYlDeYXjLSIkima+QGy4V0KyrtGT8A7n9LoWH51R4Lbjbn9rUCpdVTzDUqzP357g8XpQzgfBT0cpi0YTaVPjabDOSNHmN86PtG6RZUWxh4lTBghEoF8R9q+GIfdTP5jltkjgKYd8IKfueWLJEuiSuTEGqbM8uIGFqivWK0MM/6arHeEjNVI+HHULjiPBHsg+9XjLmeP+UEcTdOX5NCAJbLEzeC/vq7MPRuU7kcOt7+agVbpm/jn4I8udbN3jhgb+O3VlDj6Vlde9NweT626u22Hv6lYDXwXICRc4Nmtd2dCMpwPfmlKb0VRVmPpeC+RhQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://202.197.33.237:9090/Alipay/notifyUrl";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问(其实就是支付成功后返回的页面)
    public static String return_url = "http://192.168.1.107:9090/Alipay/returnUrl";
    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String CHARSET = "UTF-8";

    // 支付宝网关，这是沙箱的网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do"; //测试

    // 支付宝网关
    public static String log_path = "E:\\支付宝";

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis() + ".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}